package program.Command;

import program.SExpression;
import Exceptions.ElementPlacementError;
import Exceptions.IllegalCoordinateException;
import Exceptions.TerminationError;
import roborally.Robot;

/**
 * A class representing a MOVE command.
 * 
 * @author Jef Keijers/Bachelor of Science: Informatics
 * @version 1.0
 */

public class Move extends Command {

	/**
	 * This method moves the robot one step forward, and afterwards return null.
	 */
	@Override
	public Command execute(Robot robot) throws IllegalCoordinateException, TerminationError, ElementPlacementError {
		robot.moveForward();
		return null; 
	}

	/**
	 * This method will return the SExpression representation of move
	 */
	@Override
	public SExpression toSExpression() {
		return this.makeSingletonSExpressionList("move");
	}

}
